import Vue from 'vue'
import Router from 'vue-router'

const Rank = () => import('components/rank/Rank');
const Recommend = () => import('components/recommend/Recommend');
const Search = () => import('components/search/Search');
const Singer = () => import('components/singer/Singer');
const SingerDetall = () => import('components/singer-detall/SingerDetall');
const Disc = () => import('components/disc/Disc');
const TopList = () => import('components/top-list/TopList');
const UserCenter = () => import('components/UserCenter');

Vue.use(Router)

export default new Router({
  mode: "history",
  routes: [{
    path: '/',
    redirect: "/recommend"
  }, {
    path: '/rank',
    name: 'Rank',
    component: Rank,
    children: [{
      path: ':id',
      name: 'TopList',
      component: TopList
    }]
  }, {
    path: '/search',
    name: 'Search',
    component: Search,
    children: [{
      path: ':id',
      name: 'SearchDetall',
      component: SingerDetall
    }]
  }, {
    path: '/recommend',
    name: 'Recommend',
    component: Recommend,
    children: [{
      path: ':id',
      name: 'Disc',
      component: Disc
    }]
  }, {
    path: '/singer',
    name: 'Singer',
    component: Singer,
    children: [{
      path: ':id',
      name: 'SingerDetall',
      component: SingerDetall
    }]
  }, {
    path: '/user',
    name: 'user',
    component: UserCenter
  }]
})
